<%-- 
    Document   : top-navigation
    Created on : 08-Dec-2012, 14:53:16
    Author     : Roald
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="nl.hva.web.mvcwebapp.controllers.UserController"%>
<%-- get user type, only once --%>
<%
HttpSession session_user = request.getSession(true);
String firstname = (String) session_user.getAttribute("user_firstname");
%>
<c:if test="${empty requestScope.usertype}"><% request.setAttribute("usertype", UserController.userAccountType);%></c:if>
<%-- Header Component: /WEB-INF/widgets/top-navigation.jsp --%>
<div class="header-wrapper"> <!-- Start Header-Wrapper -->
    <div class="header left">
        <div class="logo left">
            <a href="<%=request.getContextPath()%>" alt="Three2Learn Digital Learning Experience">Three2Learn Digital Learning Experience</a>
        </div>

    </div>
    <!--<div class="language right">
        <ul>
            <li id="english"><a href="#">English</a></li>
            <li id="dutch"><a href="#">Dutch</a></li> 
        </ul>
    </div>-->

    <ul class="navigation right">
        
        <!--        <li>
                    <a href="<%=request.getContextPath()%>">Home</a>
                </li>-->
        <li>
            <a href="<%=request.getContextPath()%>/course/catalog"><font size="5">Courses</font></a>
        </li>
        <li>
            <a href="<%=request.getContextPath()%>/forum"><font size="5">Forum</font></a>
        </li>
        <li>
            <a href="<%=request.getContextPath()%>/news"><font size="5">News</font></a>
        </li>
        <li>
            <a href="<%=request.getContextPath()%>/users"><font size="5">Users</font></a>
        </li>      
        <%-- if a user is logged in, present userprofile --%>

        <c:choose>
            <c:when test="${firstname!=null}">
                <li>
                    <a href="<%=request.getContextPath()%>/user/user_profile"><font size="5">Welcome, <%=firstname%></font></a>
                </li>
                <li>
                    <a href="<%=request.getContextPath()%>/logout"><font size="5">Log out</font></a>
                </li>
            </c:when>
            <c:otherwise>
                <li>
                    <a href="<%=request.getContextPath()%>/login"><font size="5">Login</font></a>
                </li>

                <li>
                    <a href="<%=request.getContextPath()%>/register"><font size="5">Register</font></a>
                </li>
            </c:otherwise>
        </c:choose>

    </ul>
    <br class="clearfix">
</div><!-- End Header Wrapper -->
